5 ## Creating the PXE boot environment
6 Now that BareMetal OS supports the Intel 8254x (Intel Pro/1000) Gigabit network chipset it is possible to set up a network environment in VirtualBox?
8 In this example we will use a Linux VM with 2 NIC's. One on the regular network (set to bridged mode, eth0) and one set to private (Internal Network, eth1)
10 Install Linux in a 64 bit VM. In this example we used Ubuntu 11.10 64-bit. Add dhcp3-server and tftpd-hpa. Also grab NASM.
14 sudo apt-get install dhcp3-server tftpd-hpa nasm
16 In Debian/Ubuntu the config for tftpd is located at `/etc/default/tftpd-hpa`. In Fedora/Redhat the config for tftpd is located at `/etc/xinetd.d/tftp`
18 Configure eth1 to a manual IP (192.168.242.1, 255.255.255.0)
22 sudo nano -w /etc/default/isc-dhcp-server
24 enter the interface name in "INTERFACES". Enter `eth1`
26 sudo nano -w /etc/dhcp/dhcpd.conf
30 subnet 192.168.242.0 netmask 255.255.255.0 {
31 range 192.168.242.10 192.168.242.159;
32 filename "pxeboot.bin";
35 Now start the DHCP server:
37 sudo service isc-dhcp-server restart
39 At this point we can verify if the DCHP and TFTP services are running correctly. Create a new VM within VirtualBox? with no Hard Drive. Configure a single NIC to be on the private network and set the boot order to Network first.
41 On bootup of the new VM you should see this:
43 This shows the the VM successfully connected to our DHCP server and tried to download the file from the TFTP server. The failure is due to us not building and placing the file yet.
45 ## Download and build the Pure64 and BareMetal OS source
47 Now we will grab the Pure64 and BareMetal OS source code:
49 svn checkout http://baremetal.googlecode.com/svn/trunk/ baremetal
50 svn checkout http://pure64.googlecode.com/svn/trunk/ pure64
54 nasm pxestart.asm -o ../../pxestart.bin
58 Modify Pure64 so that it will work via PXE.
60 Comment the following line in `pure64.asm`:
64 Now compile Pure64 and the Kernel:
66 nasm pure64.asm -o ../pure64.sys
70 nasm kernel64.asm -o ../../kernel64.sys
74 cat pxestart.bin pure64.sys kernel64.sys > pxeboot.bin
76 The default TFTP directory is located at `/var/lib/tftpboot`
78 sudo copy pxeboot.bin /var/lib/tftpboot/
80 Reboot the PXE boot VM.